package top.techqi.hamtools.pref

import android.os.Bundle
import android.view.MenuItem
import kotlinx.android.synthetic.main.activity_about.*
import top.techqi.droidbdf.pangu.base.BaseActivity
import top.techqi.hamtools.BuildConfig
import top.techqi.hamtools.R

class AboutActivity : BaseActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_about)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)
    }

    override fun onContentChanged() {
        version.text = getString(R.string.about_version, BuildConfig.VERSION_NAME)
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        when (item.itemId) {
            android.R.id.home -> {
                onBackPressed()
                return true
            }
        }
        return super.onOptionsItemSelected(item)
    }
}
